[LINUX] Allow xenbus to be built as a module.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 17 Aug 2006 15:28:47 +0000 (16:28 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 17 Aug 2006 15:28:47 +0000 (16:28 +0100)
Signed-off-by: Steven Smith <ssmith@xensource.com>
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
linux-2.6-xen-sparse/include/xen/xenbus.h

index 6e3004077957df0cf083285f1449620e8d227675..bbe4a8c5a87c8119e1da3bc4f96ddb1796cec233 100644 (file)
@@ -346,7 +346,7 @@ static struct file_operations xenbus_dev_file_ops = {
        .poll = xenbus_dev_poll,
 };
 
-static int __init
+int __init
 xenbus_dev_init(void)
 {
        xenbus_dev_intf = create_xen_proc_entry("xenbus", 0400);
@@ -355,5 +355,3 @@ xenbus_dev_init(void)
 
        return 0;
 }
-
-__initcall(xenbus_dev_init);
index 2d42be1599825a3161e80600ed01304d68421090..9668d6d7aee459dd761e9af4dc4c1ccf171c3cf4 100644 (file)
@@ -1023,6 +1023,8 @@ static int __init xenbus_probe_init(void)
 
        xen_store_interface = mfn_to_virt(xen_store_mfn);
 
+       xenbus_dev_init();
+
        /* Initialize the interface to xenstore. */
        err = xs_init();
        if (err) {
@@ -1055,6 +1057,8 @@ static int __init xenbus_probe_init(void)
 
 postcore_initcall(xenbus_probe_init);
 
+MODULE_LICENSE("Dual BSD/GPL");
+
 
 static int is_disconnected_device(struct device *dev, void *data)
 {
@@ -1138,6 +1142,7 @@ static void wait_for_devices(struct xenbus_driver *xendrv)
                         print_device_status);
 }
 
+#ifndef MODULE
 static int __init boot_wait_for_devices(void)
 {
        ready_to_wait_for_devices = 1;
@@ -1146,3 +1151,4 @@ static int __init boot_wait_for_devices(void)
 }
 
 late_initcall(boot_wait_for_devices);
+#endif
index f65dc9b972cb162d71490a4761c763027ea8aa93..af36ef614b9fae3e3656a61c8a9c1d48c48e8fbb 100644 (file)
@@ -295,5 +295,6 @@ void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt,
 void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt,
                      ...);
 
+int __init xenbus_dev_init(void);
 
 #endif /* _XEN_XENBUS_H */